package com.yyw.foodie.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yyw.foodie.pojo.ItemsCommentsEntity;
import com.yyw.foodie.vo.ItemCommentVO;
import com.yyw.foodie.vo.center.comments.QueryCommentsVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 商品评价表  Mapper 接口
 * </p>
 *
 * @author yiyw
 * @since 2021-05-22
 */
public interface ItemsCommentsMapper extends BaseMapper<ItemsCommentsEntity> {

    /**
     * 根据商品ID获取该商品的全部评价，分页
     * @param itemId
     * @param level
     * @return
     */
    List<ItemCommentVO> page(@Param("itemId") String itemId, @Param("level") Integer level);

    /**
     * 根据用户查询该用户的全部评价，分页
     * @param userId
     * @return
     */
    List<QueryCommentsVo> pageByUser(@Param("userId") String userId);
}
